Masses of tetraquarks with two heavy quarks and open charm and bottom are calculated in the framework of the diquark-antidiquark picture in the relativistic quark model. All model parameters were regarded as fixed by previous considerations of various properties of mesons and baryons. The light quarks and diquarks are treated completely relativistically. The c quark is assumed to be heavy enough to make the diquark configurations dominating. The diquarks are considered not to be point-like but to have an internal structure which is taken into account by the calculated diquark form factor entering the diquark-gluon interaction. It is found that all the (cc)(\bar q\bar q') tetraquarks have masses above the thresholds for decays into open charm mesons. Only the I(J^P)=0(1^+) state of (bb)(\bar u\bar d) lies below the BB* threshold and is predicted to be narrow.